package com.chen.authority.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 操作日志对象
 *
 * @author chengy
 * @date 2022-11-04
 */
@Data
@TableName("sys_operation_log")
public class OperationLogPo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 操作日志主键
     */
    private Integer id;

    /**
     * 操作模块
     */
    @Excel(name = "操作模块", width = 20)
    private String module;

    /**
     * 业务类型
     */
    @Excel(name = "业务类型", width = 20, replace = {
            "新增_INSERT",
            "删除_DELETE",
            "更新_UPDATE",
            "导入_IMPORT",
            "导出_EXPORT",
            "强退_FORCE",
            "其他_OTHER"
    })
    private String businessType;

    /**
     * 方法名称
     */
    @Excel(name = "方法名称", width = 20)
    private String method;

    /**
     * 请求方式
     */
    @Excel(name = "请求方式", width = 20)
    private String reqMethod;

    /**
     * 操作人员
     */
    @Excel(name = "操作人员", width = 20)
    private String operator;

    /**
     * 请求URL
     */
    @Excel(name = "请求URL", width = 20)
    private String reqUrl;

    /**
     * 主机地址
     */
    @Excel(name = "主机地址", width = 20)
    private String ip;

    /**
     * 操作地点
     */
    @Excel(name = "操作地点", width = 20)
    private String location;

    /**
     * 请求参数
     */
    @Excel(name = "请求参数", width = 20)
    private String reqParam;

    /**
     * 响应参数
     */
    @Excel(name = "响应参数", width = 20)
    private String respParam;

    /**
     * 操作状态
     */
    @Excel(name = "操作状态", width = 20, replace = {"成功_0", "失败_1"})
    private Integer status;

    /**
     * 操作时间
     */
    @Excel(name = "操作时间", width = 20, format = DatePattern.NORM_DATETIME_PATTERN)
    private Date operTime;

    /**
     * 操作耗时
     */
    @Excel(name = "操作耗时", width = 20)
    private Long costTime;

}